#!/bin/bash

set -e

vim --clean -N -u <(echo "
  let &rtp='$PWD,'.&rtp
  let g:polyglot_test = 1
  source scripts/test_extensions.vim
  \"source scripts/test_filetypes.vim
  qa!
")

if ! expect -c 'set timeout 1' -c 'spawn vim -N --clean -c "set nomore | :helptags ./doc | q"' -c 'expect "ENTER" { exit 1 }' > /dev/null; then
  echo "Please ensure ':helptags ./doc' works properly"
  exit 1
fi
